#pragma Once
#include "ServerCal.hpp"
#include "TcpServer.hpp"

#include <iostream>
#include <sys/socket.h>
void Usage(std::string proc)
{
    std::cout << "Usage :" << proc << "  serverport" << std::endl;
}
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        return -1;
    }

    uint16_t port = std::stoi(argv[1]);
    ServerCal cal;
    TcpServer* tcp = new TcpServer(port, std::bind(&ServerCal::Calculator, &cal, std::placeholders::_1));
    tcp->InitServer();

    tcp->Start();

    return 0;
}